﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TE_Show_Answer.aspx.cs"
    Inherits="School.Pages.Teaching.TE_Show_Answer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            //click event
            $('.extentable .header').click(function (event) {
                event.preventDefault();
                var par = $(this);
                var removed = false;
                if (par.hasClass("ui-corner-all")) {
                    par.removeClass("ui-corner-all");
                    removed = true;
                }
                par.next().slideToggle('fast', function () {
                    par.toggleClass("ui-state-default").toggleClass("ui-state-active");
                    if (!removed)
                        par.addClass("ui-corner-all");
                });
            });
            // add extent, invese, collapse button
            $('.control .inverse').click(inverse);
            $('.control .collapse').click(collapse);
            $('.control .extend').click(extent);
        });
        function inverse() {
            $('.extentable .header').click();
        }
        function extent() {
            $('.extentable .header').each(function (event) {
                var par = $(this);
                if (par.hasClass("ui-corner-all")) {
                    par.removeClass("ui-corner-all");
                    par.next().slideToggle('fast', function () {
                        par.toggleClass("ui-state-default").toggleClass("ui-state-active");
                    });
                }

            });
        }
        function collapse() {
            $('.extentable .header').each(function (event) {
                var par = $(this);
                if (!par.hasClass("ui-corner-all")) {
                    par.next().slideToggle('fast', function () {
                        par.toggleClass("ui-state-default").toggleClass("ui-state-active");
                        par.addClass("ui-corner-all");
                    });
                }

            });
        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div align="right">
        <asp:ListView ID="LstSchools" runat="server" DataKeyNames="Question_Id,Id" OnItemDataBound="LstSchools_ItemDataBound">
            <EmptyDataTemplate>
                <div class="empty">
                    لا يوجد عناصر متاحة
                </div>
            </EmptyDataTemplate>
            <ItemTemplate>
                <div class="ui-corner-all ui-corner-top ui-state-default header">
                    <span class="ui-icon-ext" style="float: right;"></span>
                    <div>
                        <div class="lbl">
                            الســــؤال :
                        </div>
                        <div class="data">
                            <%# Eval("Question")%>
                        </div>
                    </div>
                </div>
                <div class="ui-corner-bottom detail" style="display: none">
                    <div>
                        <div class="lbl">
                            الإجابات:
                        </div>
                        <div class="data">
                            <asp:Label ID="lblanswer" runat="server"></asp:Label>
                        </div>
                        <asp:EntityDataSource ID="EdsrdbChoice" runat="server" ConnectionString="name=SchoolEntities"
                            DefaultContainerName="SchoolEntities" EnableFlattening="False" EntitySetName="Vanswers"
                            Select="it.[Id], it.[Student_Id], it.[Question_Id], it.[Answer_Id], it.[Choices]"
                            AutoGenerateWhereClause="True">
                        </asp:EntityDataSource>
                    </div>
                </div>
            </ItemTemplate>
            <LayoutTemplate>
                <div id="itemPlaceholderContainer" runat="server" class="default padding_right_left extentable">
                    <div runat="server" id="itemPlaceholder" />
                </div>
                <div class="lvpager">
                    <asp:DataPager ID="DataPager1" runat="server" PageSize="10">
                        <Fields>
                            <asp:NextPreviousPagerField ShowFirstPageButton="false" ShowNextPageButton="False"
                                PreviousPageText="السابق" ButtonType="Link" />
                            <asp:NumericPagerField ButtonType="Link" />
                            <asp:NextPreviousPagerField ShowLastPageButton="false" ShowPreviousPageButton="False"
                                NextPageText="التالى" ButtonType="Link" />
                        </Fields>
                    </asp:DataPager>
                </div>
            </LayoutTemplate>
        </asp:ListView>
    </div>
    <div align="center">
    </div>
    </form>
</body>
</html>
